home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / Documents / JAVA Programming / examples / 12 / PropDemo.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-09-08  |  1.4 KB  |  20 lines

  1. import java.util.Hashtable;
  2. import java.util.Properties;
  3.  
  4. class PropDemo {
  5.    static Properties prop = new Properties();
  6.  
  7.    public static void main(String[] var0) {
  8.       prop.put("Title", "put title here");
  9.       prop.put("Author", "put name here");
  10.       prop.put("isbn", "isbn not set");
  11.       Properties var1 = new Properties(prop);
  12.       ((Hashtable)var1).put("Title", "The Java Handbook");
  13.       ((Hashtable)var1).put("Author", "Patrick Naughton");
  14.       System.out.println("Title: " + var1.getProperty("Title"));
  15.       System.out.println("Author: " + var1.getProperty("Author"));
  16.       System.out.println("isbn: " + var1.getProperty("isbn"));
  17.       System.out.println("ean: " + var1.getProperty("ean", "???"));
  18.    }
  19. }
  20.